from rclpy.node import Node
import rclpy
from example_interfaces.srv import AddTwoInts
class Service_Server(Node):
    def __init__(self,name):
        super().__init__(name)
        self.get_logger().info('This is a server:{}'.format(name))
        self.add_two_ints_service = self.create_service(AddTwoInts,"ints_add",self.hand_ints_add)

    def hand_ints_add(self,request,response):
        self.get_logger().info(f'get request,computing {request.a} + {request.b}')
        response.sum = request.a + request.b
        return response

def main(args=None):
    rclpy.init(args=args)
    node = Service_Server('service_svr')
    rclpy.spin(node)
    rclpy.shutdown()